package com.hp.service;

import com.hp.dao.PhotoMapper;
import com.hp.pojo.Photo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class PhotoService {

    @Autowired private PhotoMapper photoMapper;

    public Map<String, Object> getPhoto(int houseId) {
        Map<String, Object> allPhotos =new HashMap<>();
        List<Photo> photots = new ArrayList<>();
        photots.addAll(photoMapper.seletPhoto(houseId));
        allPhotos.put("photo",photots);
        return allPhotos;
    }
}
